package com.jwsoft.manager.core.task.sms;

import com.alibaba.fastjson.JSON;
import com.jwsoft.manager.common.vo.eduSendContent.EduSendContentQueryVO;
import com.jwsoft.manager.core.integration.EduSendContentIntegration;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zjl
 * @version 1.0
 * @date 2024/7/2 0002 17:01
 */
@Component
@Slf4j
public class SendMessageXxlJob {
    @Autowired
    private EduSendContentIntegration eduSendContentIntegration;
    @XxlJob("sendMessageXxlJobHandler")
    public void sendMessageXxlJobHandler() {
        XxlJobHelper.log("XXL-JOB, sendMessageXxlJobHandler");
        String param = XxlJobHelper.getJobParam();
        EduSendContentQueryVO vo = JSON.parseObject(param, EduSendContentQueryVO.class);
        log.info("短信发送开始执行");
        eduSendContentIntegration.timerSendMessage(vo);
        log.info("短信发送执行结束");
    }
}
